<template>
  <div class="ele-body">
    <div>
      <el-form
        ref="form"
        :model="form"
        :rules="rules"
        label-width="140px">
<!--        <div class="script_text">-->
<!--          <div class="explain">* 激活页面的话术会将您自定义的修改为无敏感词的，如原话术需要请自行保存</div>-->
<!--          <div class="explain">* 订单号输入框自动去除，仅需输入姓名和邮箱就可以激活成功，无任何后续流程</div>-->
<!--          <div class="explain">* 激活的数据会在后台“订单与客户”-“纯保修激活客户”</div>-->
<!--          <div class="explain">*-->
<!--            激活几天后，可一键后台邮件跟进，邮件带上回访链接，可以再次继续后续流程，相当于发了一封电子明信片，安全无风险-->
<!--          </div>-->
<!--          <div class="explain">* 建议重新去“保修卡”可下载纯保修卡模板</div>-->
<!--          <div class="explain">* 主题会变为黑色的模板</div>-->
<!--          <div class="explain">* 每个IP仅能激活一次</div>-->
<!--          <div class="explain">* 建议开启前可联系客服微信或扫描右边二维码: zhmj2103 询问清楚，并亲身体验</div>-->
<!--        </div>-->
        <div>
          <el-alert
            title="激活设置"
            type="warning"
            style="margin-top: 10px"
            :closable="false">
          </el-alert>
        </div>

        <el-row :gutter="15">
          <el-col style="float: left" :md="12" :sm="30">
            <el-card shadow="never" body-style="padding: 25px;" style="height: 350px">
              <el-form-item label="联系邮箱" prop="contact_email">
                <el-input
                  class="form_width"
                  v-model="form.contact_email"
                  placeholder="请输入联系邮箱"
                  clearable/>&nbsp;
                <el-popover
                  placement="right"
                  width="450"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">此邮箱为必填，客户输错订单号和最后页面都会展示此邮箱。</div>
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="@/assets/evaluation/contact_email_1.png" style="width: 640px">
                      <img slot="reference" src="@/assets/evaluation/contact_email_1.png"
                           style="width: 450px; cursor:pointer">
                    </el-popover>
                  </div>
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="@/assets/evaluation/contact_email_2.png" style="width: 640px">
                      <img slot="reference" src="@/assets/evaluation/contact_email_2.png"
                           style="width: 450px; cursor:pointer">
                    </el-popover>
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>

              </el-form-item>
              <el-form-item label="激活失败展示邮箱" prop="activate_dispaly_email">
                <el-select class="form_width" v-model="form.activate_dispaly_email">
                  <el-option v-for="item in config.activate_dispaly_email" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  width="450"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">开启后，客户输入订单号不对或者由于卖家没及时导入系统订单，导致客户激活不成功时，
                    给客户展示联系邮箱信息，尽量开启，否则找不到人可能会站内信联系。一般极特殊不想管理激活失败买家的卖家才关闭。
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <el-form-item label="是否打开填写邮箱功能" prop="email_show">
                <el-select class="form_width" v-model="form.email_show">
                  <el-option v-for="item in config.activate_only_once" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">用户注册激活是否需要提供邮箱填写;如果不开启则关闭后续所有流程
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <el-form-item label="是否展示礼品选择界面" prop="display_gift_select">
                <el-select class="form_width" v-model="form.display_gift_select">
                  <el-option v-for="item in config.display_gift_select" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  width="450"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">开启后，客户可以选择sku对应的礼品
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <el-form-item v-if="form.display_gift_select==2" prop="gift_platform_sku">
                <el-input
                  v-model="form.comment_gift_platform_sku"
                  placeholder="多个Sku请用;隔开"
                  :rows="2"
                  style="width: 260px"
                  type="textarea"/>
              </el-form-item>
            </el-card>
          </el-col>
          <el-col style="float: left" :md="12" :sm="30">
            <el-card shadow="never" body-style="padding: 25px;" style="height: 350px">
              <el-form-item label="过滤折扣订单" prop="filter_discount_orders">
                <el-select class="form_width" v-model="form.filter_discount_orders">
                  <el-option v-for="item in config.filter_discount_orders" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  width="450"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">设置过滤折扣单后，达到该折扣条件的订单激活的话会只提示客户激活保修成功，不展示礼品，也不引导留评。
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <el-form-item label="仅激活一次" prop="activate_only_once">
                <el-select class="form_width" v-model="form.activate_only_once">
                  <el-option v-for="item in config.activate_only_once" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">开启此功能后，同一个订单号在第一次激活成功的一小时后再次激活将不会触发正常的引导流程，而是只会提示已经激活成功。
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>

              </el-form-item>
              <el-form-item label="是否让用户走留评流程" prop="display_comment_link">
                <el-select class="form_width" v-model="form.display_comment_link">
                  <el-option v-for="item in config.display_comment_link" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  width="450"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">开启后，客户可以走留评操作
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <el-form-item v-if="form.display_comment_link==2" prop="comment_platform_sku">
                <el-input
                  v-model="form.comment_platform_sku"
                  placeholder="多个Sku请用;隔开"
                  :rows="2"
                  style="width: 260px"
                  type="textarea"/>
              </el-form-item>
            </el-card>
          </el-col>
        </el-row>

        <div>
          <el-alert
            title="留评引导设置"
            type="warning"
            :closable="false">
          </el-alert>
        </div>

        <el-row :gutter="15">
          <el-col style="float: left" :md="12" :sm="30">
            <el-card shadow="never" body-style="padding: 25px;" style="height: 370px">
<!--              <el-form-item label="星级" prop="star_rating">-->
<!--                <el-select class="form_width" v-model="form.star_rating">-->
<!--                  <el-option v-for="item in config.star_rating" :key="item.val" :label="item.label"-->
<!--                             :value="item.val"/>-->
<!--                </el-select>&nbsp;-->
<!--                <el-popover-->
<!--                  placement="right"-->
<!--                  trigger="hover">-->
<!--                  <div style="font-size: 13px;color: red">当星级选择 5 星的时候，系统会自动过滤少于 5 星的，以此类推。-->
<!--                  </div>-->
<!--                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>-->
<!--                </el-popover>-->
<!--              </el-form-item>-->
              <el-form-item label="手机号必填" prop="phone_require">
                <el-select class="form_width" v-model="form.phone_require">
                  <el-option v-for="item in config.phone_require" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">当“礼品设置-引导方式”为常规礼品时，该选项有效。
                  </div>
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="@/assets/evaluation/phone_require.png" style="width: 640px">
                      <img slot="reference" src="@/assets/evaluation/phone_require.png"
                           style="width: 450px; cursor:pointer">
                    </el-popover>
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <el-form-item label="自动加入评论监控" prop="auto_comment_monitor">
                <el-select class="form_width" v-model="form.auto_comment_monitor">
                  <el-option v-for="item in config.auto_comment_monitor" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  width="450"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">当开启后，如果有新的国家的Asin来激活，没有添加评价监控的话，会自动添加进来，方便及时匹配。
                    如果是已经添加过并且删除的，不会自动再次添加，需要去回收站里手动恢复。
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <el-form-item label="How to find my orderID?">
                <el-input
                  v-model="form.find_my_order"
                  :rows="2"
                  style="width: 260px"
                  type="textarea"/>&nbsp;
              </el-form-item>
              <el-form-item label="留评敏感词过滤">
                <el-input
                  v-model="form.comment_sensitive_word"
                  placeholder="多个敏感词请用;隔开"
                  :rows="2"
                  style="width: 260px"
                  type="textarea"/>&nbsp;
                <el-popover
                  placement="right"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">当评价的内容含有设置的敏感词时,系统会自动过滤。
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
            </el-card>
          </el-col>
          <el-col style="float: left" :md="12" :sm="30">
            <el-card shadow="never" body-style="padding: 25px;" style="height: 370px">
              <el-form-item label="评论最少字符数" prop="comment_mini_char">
                <el-input style="width: 260px" v-model.number="form.comment_mini_char" autocomplete="off"></el-input>&nbsp;
                <el-popover
                  placement="right"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">相关功能位置
                  </div>
                  <div class="ele-exception-img">
                    <el-popover placement="top-start" trigger="click">
                      <img src="@/assets/evaluation/comment_mini_char.png" style="width: 640px">
                      <img slot="reference" src="@/assets/evaluation/comment_mini_char.png"
                           style="width: 450px; cursor:pointer">
                    </el-popover>
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <el-form-item label="是否展示收货地址界面" prop="address_show">
                <el-select class="form_width" v-model="form.address_show">
                  <el-option v-for="item in config.address_show" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">当“礼品设置-引导方式”为常规礼品时，该选项有效。
                    <br/>当选择否时,不展示整个收货地址界面
                  </div>
<!--                  <div class="ele-exception-img">-->
<!--                    <el-popover placement="top-start" trigger="click">-->
<!--                      <img src="@/assets/evaluation/adress_show.png" style="width: 640px">-->
<!--                      <img slot="reference" src="@/assets/evaluation/adress_show.png"-->
<!--                           style="width: 450px; cursor:pointer">-->
<!--                    </el-popover>-->
<!--                  </div>-->
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <el-form-item label="地址默认数据清空" prop="address_default_clear">
                <el-select class="form_width" v-model="form.address_default_clear">
                  <el-option v-for="item in config.address_default_clear" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  width="450"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">默认客户留评后，填写收货地址的地址栏是带地址信息的，但亚马逊为保护隐私导致地址残缺，需要客户完善，
                    如果担心买家不注意看收货地址，可以选择清空数据，让买家完全自己填写输入。
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <el-form-item label="敏感词不引导" prop="address_show">
                <el-select class="form_width" v-model="form.sensitive_word_no">
                  <el-option v-for="item in config.sensitive_word_no" :key="item.val" :label="item.label"
                             :value="item.val"/>
                </el-select>&nbsp;
                <el-popover
                  placement="right"
                  width="450"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">开启此功能后，如果客户评论内容里检测到有敏感词，将不再引导该客户去亚马逊留评页，
                    并且该客户的激活信息会被标识为“敏感词用户”
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
              <br/>
            </el-card>
          </el-col>
        </el-row>

        <div>
          <el-alert
            title="其他设置"
            type="warning"
            :closable="false">
          </el-alert>
        </div>

        <el-row :gutter="15">
          <el-col style="float: left" :md="12" :sm="30">
            <el-card shadow="never" body-style="padding: 25px;">
              <el-form-item label="同一ip日弹窗1次" prop="ip_pop">
                  <el-select class="form_width" v-model="form.ip_pop">
                    <el-option v-for="item in config.ip_pop" :key="item.val" :label="item.label"
                               :value="item.val"/>
                  </el-select>&nbsp;
                <el-popover
                  placement="right"
                  width="450"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">开启后，同一个客户IP同一日多次访问激活链接，只有第一次弹窗显示保修激活，后面则以小挂件的形式在网页右下方展示，
                    主动点击才会弹窗保修激活页面，一般开启该功能是在自己独立站怕影响买家正常访问其他网页被影响，故开启只弹一次。</div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>

              </el-form-item>
            </el-card>
          </el-col>
          <el-col style="float: left" :md="12" :sm="30">
            <el-card shadow="never" body-style="padding: 25px;">
              <el-form-item label="引导后秒数" prop="jump_second">
                <el-input style="width: 260px" v-model.number="form.jump_second" autocomplete="off"></el-input>&nbsp;
                <el-popover
                  placement="right"
                  trigger="hover">
                  <div style="font-size: 13px;color: red">在引导后，切换下一个页面出现的时间。
                  </div>
                  <i slot="reference" class="el-icon-warning" style="color: rgba(255, 140, 0, 1)"></i>
                </el-popover>
              </el-form-item>
            </el-card>
          </el-col>
        </el-row>

        <el-card shadow="never" body-style="padding-top: 5px;">
          <el-tabs v-model="active" class="user-info-tabs">
            <el-tab-pane label="English" name="English">
              <el-row :gutter="15" class="script_style">
                <el-col style="float: left" :md="12" :sm="16">

                  <el-card shadow="never" body-style="padding-top: 5px;">
                    <div>
                      <el-alert
                        title="激活用户页"
                        type="warning"
                        :closable="false">
                      </el-alert>
                    </div>
                    <el-form-item label="话术1" prop="script_1">
                      <el-input v-model="form.register_page_script.script_1" autocomplete="off"></el-input>
                    </el-form-item>
                  </el-card>
                </el-col>
                <el-col style="float: left" :md="12" :sm="16">
                  <el-card shadow="never" body-style="padding-top: 5px;">
                    <div class="ele-exception-img">
                      <el-popover placement="top-start" trigger="click">
                        <img src="/static/activate_user_page.png" style="height: 450px">
                        <img slot="reference" src="/static/activate_user_page.png"
                             style="width: 200px; cursor:pointer">
                      </el-popover>
                    </div>
                  </el-card>
                </el-col>

              </el-row>
            </el-tab-pane>
            <el-tab-pane label="German" name="German">
              <el-row :gutter="15" class="script_style">
                <el-col style="float: left" :md="12" :sm="16">

                  <el-card shadow="never" body-style="padding-top: 5px;">
                    <div>
                      <el-alert
                        title="激活用户页"
                        type="warning"
                        :closable="false">
                      </el-alert>
                    </div>
                    <el-form-item label="话术1" prop="script_1">
                      <el-input v-model="form.register_page_script_ger.script_1" autocomplete="off"></el-input>
                    </el-form-item>
                  </el-card>
                </el-col>
                <el-col style="float: left" :md="12" :sm="16">
                  <el-card shadow="never" body-style="padding-top: 5px;">
                    <div class="ele-exception-img">
                      <el-popover placement="top-start" trigger="click">
                        <img src="/static/activate_user_page.png" style="height: 450px">
                        <img slot="reference" src="/static/activate_user_page.png"
                             style="width: 200px; cursor:pointer">
                      </el-popover>
                    </div>
                  </el-card>
                </el-col>
              </el-row>
            </el-tab-pane>
            <el-tab-pane label="Italian" name="Italian">
              <el-row :gutter="15" class="script_style">
                <el-col style="float: left" :md="12" :sm="16">

                  <el-card shadow="never" body-style="padding-top: 5px;">
                    <div>
                      <el-alert
                        title="激活用户页"
                        type="warning"
                        :closable="false">
                      </el-alert>
                    </div>
                    <el-form-item label="话术1" prop="script_1">
                      <el-input v-model="form.register_page_script_it.script_1" autocomplete="off"></el-input>
                    </el-form-item>
                  </el-card>
                </el-col>
                <el-col style="float: left" :md="12" :sm="16">
                  <el-card shadow="never" body-style="padding-top: 5px;">
                    <div class="ele-exception-img">
                      <el-popover placement="top-start" trigger="click">
                        <img src="/static/activate_user_page.png" style="height: 450px">
                        <img slot="reference" src="/static/activate_user_page.png"
                             style="width: 200px; cursor:pointer">
                      </el-popover>
                    </div>
                  </el-card>
                </el-col>
              </el-row>
            </el-tab-pane>
            <el-tab-pane label="Spanish" name="Spanish">
              <el-row :gutter="15" class="script_style">
                <el-col style="float: left" :md="12" :sm="16">

                  <el-card shadow="never" body-style="padding-top: 5px;">
                    <div>
                      <el-alert
                        title="激活用户页"
                        type="warning"
                        :closable="false">
                      </el-alert>
                    </div>
                    <el-form-item label="话术1" prop="script_1">
                      <el-input v-model="form.register_page_script_sp.script_1" autocomplete="off"></el-input>
                    </el-form-item>
                  </el-card>
                </el-col>
                <el-col style="float: left" :md="12" :sm="16">
                  <el-card shadow="never" body-style="padding-top: 5px;">
                    <div class="ele-exception-img">
                      <el-popover placement="top-start" trigger="click">
                        <img src="/static/activate_user_page.png" style="height: 450px">
                        <img slot="reference" src="/static/activate_user_page.png"
                             style="width: 200px; cursor:pointer">
                      </el-popover>
                    </div>
                  </el-card>
                </el-col>
              </el-row>
            </el-tab-pane>
            <el-tab-pane label="Japanese" name="Japanese">
              <el-row :gutter="15" class="script_style">
                <el-col style="float: left" :md="12" :sm="16">

                  <el-card shadow="never" body-style="padding-top: 5px;">
                    <div>
                      <el-alert
                        title="激活用户页"
                        type="warning"
                        :closable="false">
                      </el-alert>
                    </div>
                    <el-form-item label="话术1" prop="script_1">
                      <el-input v-model="form.register_page_script_jp.script_1" autocomplete="off"></el-input>
                    </el-form-item>
                  </el-card>
                </el-col>
                <el-col style="float: left" :md="12" :sm="16">
                  <el-card shadow="never" body-style="padding-top: 5px;">
                    <div class="ele-exception-img">
                      <el-popover placement="top-start" trigger="click">
                        <img src="/static/activate_user_page.png" style="height: 450px">
                        <img slot="reference" src="/static/activate_user_page.png"
                             style="width: 200px; cursor:pointer">
                      </el-popover>
                    </div>
                  </el-card>
                </el-col>
              </el-row>
            </el-tab-pane>
          </el-tabs>
        </el-card>

        <div style="height: 100px"></div>
        <div class="data-cls">
          <el-button type="success" class="el-button el-button--primary el-button--medium" @click="save">保存设置</el-button>
        </div>
      </el-form>
    </div>

  </div>
</template>

<script>

export default {
  name: 'BuyerIndex',
  components: {},
  data() {
    return {
      // tab页选中
      active: 'English',
      // 表单数据
      form: {
        contact_email:"",
        activate_dispaly_email:1,
        only_activate:1,
        email_show:1,
        display_comment_link:1,
        display_gift_select:1,
        filter_discount_orders:1,
        activate_only_once:2,
        star_rating:1,
        comment_mini_char:10,
        phone_require:1,
        auto_comment_monitor:1,
        phone_show:1,
        address_show:1,
        address_default_clear:2,
        comment_sensitive_word:"",
        sensitive_word_no:1,
        ip_pop:2,
        jump_second:3,
        register_page_script:{
          script_1:'',
          script_2:'',
        },
        register_page_script_ger:{
          script_1:'',
          script_2:'',
        },
        register_page_script_it:{
          script_1:'',
          script_2:'',
        },
        register_page_script_sp:{
          script_1:'',
          script_2:'',
        },
        register_page_script_jp:{
          script_1:'',
          script_2:'',
        },
        register_success_page_script:{
          script_1:'',
        },
        register_success_page_script_ger:{
          script_1:'',
        },
        register_success_page_script_it:{
          script_1:'',
        },
        register_success_page_script_sp:{
          script_1:'',
        },
        register_success_page_script_jp:{
          script_1:'',
        },
        register_no_page_script:{
          script_1:'',
        },
        gift_select_page_script:{
          script_1:'',
        },
        comment_page_script:{
          script_1:'',
          script_2:'',
          script_3:'',
          script_4:'',
        },
        amazon_comment_page_script:{
          script_1:'',
          script_2:'',
          script_3:'',
        },
        gift_product_page_script:{
          script_1:'',
        },
        gift_end_page_script:{
          script_1:'',
          script_2:'',
        }
      },
      // 表单验证规则
      rules: {
        contact_email: [
          {required: true, message: '请输入联系邮箱', trigger: 'blur'}
        ],
        nickname: [
          {required: true, message: '请输入昵称', trigger: 'blur'}
        ],
        gender: [
          {required: true, message: '请选择性别', trigger: 'blur'}
        ],
        email: [
          {required: true, message: '请输入邮箱', trigger: 'blur'}
        ],
        comment_mini_char: [
          { type: 'number', message: '评论最少字符数必须为数字值'}
        ],
        jump_second: [
          { type: 'number', message: '引导后秒数必须为数字值'}
        ],
      },
      config: Object,
      // 保存按钮loading
      loading: false,
      // 是否显示裁剪弹窗
      showCropper: false
    };
  },
  mounted() {
    //获取配置信息
    this.getBuyerConfig();
    //获取买家端数据
    this.getBuyerData();
  },
  methods: {
    /* 获取配置信息 */
    getBuyerConfig() {
      this.$http.get('/buyer/getBuyerConfig').then((res) => {
        const result = res.data;
        if (result.code === 0) {
          // 赋予对象值
          this.config = result.data
        } else {
          this.$message.error(result.msg);
        }
      }).catch((e) => {
        console.error(e);
        this.$message.error(e.message);
      });
    },
    getBuyerData(){
      this.$http.get('/buyer/getBuyerData').then((res) => {
        const result = res.data;
        if (result.code === 0) {
          // 赋予对象值
          this.form = result.data
        } else {
          this.$message.error(result.msg);
        }
      }).catch((e) => {
        console.error(e);
        this.$message.error(e.message);
      });
    },
    /* 保存更改 */
    save() {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          this.loading = true;
          this.$http.post('/buyer/edit', this.form).then(res => {
            this.loading = false;
            if (res.data.code === 0) {
              this.$message.success('保存成功');
            } else {
              this.$message.error(res.data.msg);
            }
          }).catch(e => {
            this.loading = false;
            this.$message.error(e.message);
          });
        } else {
          return false;
        }
      });
    }
  }
}
</script>

<style scoped>
.ele-body {
  padding-bottom: 0;
}

.el-card {
  margin-bottom: 15px;
}

.script_style .el-form-item {
  margin-bottom: 8px;
}

/* 用户资料卡片 */
.user-info-card {
  padding-top: 8px;
  text-align: center;
}

.form_width {
  width: 260px;
}



.data-cls{
  bottom: 0;
  left: 273px;
  right: 0;
  background: #fff;
  height: 60px;
  line-height: 60px;
  text-align: center;
  position: fixed;
  z-index: 999;
  -webkit-box-shadow: 0 -1px 4px rgb(0 21 41/8%);
  box-shadow: 0 -1px 4px rgb(0 21 41/8%);
  -webkit-transition: all .2s;
  transition: all .2s;
}



::v-deep .el-form-item__label {
  color: #222;
  font-weight: bold;
}

.script_text {
  background-color: #fff2e6;
  font-size: 14px;
  color: #ff7c00;
  padding: 15px;
  display: -webkit-box;
  display: -ms-flexbox;
  border: 1px solid #ffe1c4;
}

.explain {
  margin-top: 8px;
}

.user-info-card .user-info-avatar-group {
  position: relative;
  cursor: pointer;
  margin: 0 auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
}

.user-info-card .user-info-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info-card .user-info-avatar-group > i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #FFF;
  font-size: 30px;
  display: none;
  z-index: 2;
}

.user-info-card .user-info-avatar-group:hover > i {
  display: block;
}

.user-info-card .user-info-avatar-group:hover:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, .3);
}

.user-info-card .user-info-name {
  font-size: 24px;
  margin-top: 20px;
}

.user-info-card .user-info-desc {
  margin-top: 8px;
}

/* 用户信息列表 */
.user-info-list {
  margin-top: 30px;
}

.user-info-list .user-info-item {
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
}

.user-info-item > i {
  margin-right: 10px;
  font-size: 16px;
}

.user-info-item > span {
  flex: 1;
  display: block;
}

/* 用户标签 */
.user-info-tags .el-tag {
  margin: 10px 10px 0 0;
}

/* 用户账号绑定列表 */
.user-account-list {
  margin-top: 10px;
}

.user-account-list .user-account-item {
  padding: 15px;
}

.user-account-list .user-account-item .ele-text-secondary {
  margin-top: 6px;
}

.user-account-list .user-account-item .user-account-icon {
  width: 42px;
  height: 42px;
  line-height: 42px;
  text-align: center;
  color: #FFF;
  font-size: 26px;
  border-radius: 50%;
  background-color: #3492ED;
  box-sizing: border-box;
}

.user-account-list .user-account-item .user-account-icon.el-icon-_wechat {
  background-color: #4DAF29;
  font-size: 28px;
}

.user-account-list .user-account-item .user-account-icon.el-icon-_alipay {
  background-color: #1476FE;
  padding-left: 5px;
  font-size: 32px;
}

/* tab页签 */
.user-info-tabs ::v-deep .el-tabs__nav-wrap {
  padding-left: 20px;
}
</style>
